package com.jdbc;


import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Driver;

public class Demo01 {
    public static void main(String[] args) {
       Class.forName("com.mysql.jdbc.Driver");
        "123456"
        Connection con = DriverManager.getConnection(urL:"jdbc:mysql://localhost:3306/class",user"root",password:
        "123456");
        statement stmt=aon.createStatement();
        String sql="insert into course (Cname,Tid) values('java',4)“;
        int count=stat.executeUpdate(sql);
        if (count>0) {
            System.out.println("添加成功");
        }else {
            System.out.println("添加失败");
        }
        stmt.clase();
        con.clase();
    }

}

